﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Sisocana.Core.Models.PersonaDesaparecidaFullModel>" %>

<a class="result-link" href="<%= Url.Action("FoundPerson","Person", new { id = Model.id,
                                                                          externalEntity = Model.externalEntity,
                                                                          searchWSId = Model.searchWSId,
                                                                          idSitio = Model.idSitio,
                                                                          name = Model.nombre,
                                                                          lastName = Model.apellido,
                                                                          date = Model.fecha,
                                                                          phone = Model.celular
                                                                         })%>" />
    <span class="resultImageContainer">
    <% if(!Model.externalEntity)
    { %>
        <img class='resultImage' alt="photo" src="<%= Model.foto.imgNombre != null ? Url.Action("image","Person", new { id = Model.id }) : Url.Content("~/Content/images/no-photo.gif") %>" />
    <% }
    else
    { %>
        <img class='resultImage' alt="photo" src="<%= Model.imageSrc != null ? Model.imageSrc : Url.Content("~/Content/images/no-photo.gif") %>" />
    <% } %>
    </span>
    <span class="resultData">
        <span class="resultDataTitle"><%= Model.nombre + " " + Model.apellido %> </span>
        <ul>
            <li> Last report status: 
            <% switch (Model.Reports.Last().status){%>
            <% case "A": %> This person is believed to be alive<% break; %>
            <% case "D": %> This person is believed to be dead<% break; %>
            <% case "M": %> This person is believed to be missing<% break; %>            
            <% case "I": %> Someone is seeking information about this person<% break; %>
            <% case "U": %> Unknown <% break; %>
            <% default: %> Unknown <% break; %>
            <% } %>
            </li>
            <% if (!Model.externalEntity){ %>
            <li>
                Total reports: <%= Model.TotalReports %>             
            </li>
            <% } %>
        </ul>
    </span>
</a>